﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LeafCore.Components.SSO
{
    public static class OSSServiceExtensions
    {
        public static IServiceCollection AddFileUplaod(this IServiceCollection services, Action<OSSServiceOptions> aliyunoss)
        {
            var options = new OSSServiceOptions();
            aliyunoss.Invoke(options);
            services.AddSingleton<IOSSService>(sp => new OSSService(sp.GetRequiredService<ILoggerFactory>(), options));
            return services;
        }
    }
}
